package org.dtrd.modules.record.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.dtrd.modules.patient.entity.bean.report.ReportDrugSuggest;
import org.dtrd.modules.record.entity.bean.SigninSuggestBean;
import org.dtrd.modules.record.entity.bean.SigninSuggestDailyInfo;
import org.dtrd.modules.record.entity.po.DtrdEntRdSigninSuggest;
import org.dtrd.modules.record.entity.request.DailyRequest;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 打卡建议 服务类
 * </p>
 *
 * @author QR
 * @since 2021-10-21
 */
public interface IDtrdEntRdSigninSuggestService extends IService<DtrdEntRdSigninSuggest> {

    /**
     * 通过 patientId 和 建议类型获取建议内容
     */
    SigninSuggestBean getSuggestByPatientIdAndType(Integer patientId, Integer type);

    /**
     * 通过 patientId 和 建议类型查询建议Map
     *
     * @return
     */
    List<SigninSuggestBean> getSuggestByPatientIdAndTypes(Integer patientId, Integer... type);

    /**
     * 获取每日的建议内容
     *
     * @return
     */
    Map<Integer, String> getDailySuggest(Integer patientId, Date date, Integer... suggestTypes);

    /**
     * 按周获取每周最新的打卡建议
     */
    Map<String, List<DtrdEntRdSigninSuggest>> getWeeklySuggestMap(Integer patientId, Date startDate, Date endDate, Integer... suggestTypes);

    /**
     * 添加或修改建议记录对象
     */
    boolean saveOrUpdateSuggestRecord(SigninSuggestBean suggest);

    IPage<SigninSuggestBean> selectSigninSuggestPage(Integer pageNum, Integer pageSize, Integer patientId, String startDate, String endDate);

    /**
     * 批量进行添加或修改
     *
     * @param info 请求数据
     * @return 添加或修改的操作结果
     */
    boolean saveOrUpdateSuggestBatch(SigninSuggestDailyInfo info);

    /**
     * 获取某日的建议内容
     *
     * @param request 请求对象
     * @return 每日建议内容对象
     */
    SigninSuggestDailyInfo getSuggestRecord(DailyRequest request);

    /**
     * 查询指定日期之前最近的饮食建议
     *
     * @param patientId
     * @param date
     * @return
     */
    DtrdEntRdSigninSuggest getLatestSuggest(Integer patientId, String date);

    List<ReportDrugSuggest> getDrudSuggestList(Integer patientId);
}
